package a.acceltest;

import android.os.Bundle;
import android.app.ListActivity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Option extends ListActivity {

	String classes[] = {"TouchDraw", "MotionDraw"};
	
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, classes));
//        setContentView(R.layout.activity_option);
    }
    
    @Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_home, menu);
		return true;
	}
    
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		// TODO Auto-generated method stub
		super.onListItemClick(l, v, position, id);
		String name = classes[position];
		try {
			Class C = Class.forName("a.acceltest."+name);
			Intent I = new Intent(Option.this,C);
			I.putExtra("state", "new");
			startActivity(I);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
	}
}
